package org.zhangchao.poi.excel.create;

import java.io.File;
import java.io.InputStream;

import org.zhangchao.poi.excel.interceptor.ExcelHandlerInterceptorStack;
import org.zhangchao.poi.excel.interceptor.ExcelProcessModelHandlerInterceptor;


/**
 * 
 * @author zhangchao
 *
 */
public class ExcelProcessModelCreate<E> extends ExcelBaseCreate<E> {
	
	/**
	 * 
	 */
	public ExcelProcessModelCreate() {
		super();
	}
	
	/**
	 * -1, > 0
	 * @param i -1, > 0
	 */
	public ExcelProcessModelCreate(int i) {
		super(i);
	}
	
	/**
	 * 
	 * @param clazz
	 */
	public ExcelProcessModelCreate(Class<?> clazz) {
		super();
		init(clazz);
	}
	
	/**
	 * 
	 * @param clazz
	 * @param templateFile
	 */
	public ExcelProcessModelCreate(Class<?> clazz, File templateFile) {
		super(templateFile);
		init(clazz);
	}
	
	/**
	 * 
	 * @param clazz
	 * @param is
	 */
	public ExcelProcessModelCreate(Class<?> clazz, InputStream is) {
		super(is);
		init(clazz);
	}
	
	
	
	/**
	 * 
	 * @param i
	 * @param clazz
	 */
	public ExcelProcessModelCreate(int i, Class<?> clazz) {
		super(i);
		init(clazz);
	}
	
	/**
	 * 
	 * @param i
	 * @param clazz
	 * @param templateFile
	 */
	public ExcelProcessModelCreate(int i, Class<?> clazz, File templateFile) {
		super(i, templateFile);
		init(clazz);
	}
	
	/**
	 * 
	 * @param i
	 * @param clazz
	 * @param is
	 */
	public ExcelProcessModelCreate(int i, Class<?> clazz, InputStream is) {
		super(i, is);
		init(clazz);
	}
	
	/**
	 * 初始化设置
	 */
	private void init(Class<?> clazz) {
		//穿件拦截器栈
		setHandlerStack(new ExcelHandlerInterceptorStack());
		//excel 拦截器--把excle行封装成对象
		ExcelProcessModelHandlerInterceptor epmhi = new ExcelProcessModelHandlerInterceptor(clazz);
		getHandlerStack().add(epmhi);
	}
	
}
